package cn.dengta.webapp.push.dto;

import java.util.Date;

import cn.dengta.webapp.base.vo.AbstractVO;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.NumberUtil;

@Getter
@Setter
public class LikeMeUnreadDTO extends AbstractVO<Void> {

	/** 总未读数 */
	public Long unread;
	/** 头像 */
	protected String avatar;
	/** 信息 */
	protected String msg;
	/** 对应总数 */
	private Integer total;
	/** 事件类型：0=访客；1=喜欢；2=好友； */
	protected Integer eventType;
	protected Date time = new Date();

	public LikeMeUnreadDTO() {
	}

	public LikeMeUnreadDTO(Long unread, String avatar, String msg, Integer eventType) {
		this.unread = unread;
		this.avatar = avatar;
		this.msg = msg;
		this.eventType = eventType;
	}

	public static LikeMeUnreadDTO of(Integer followedUnreadCount, Integer visitedUnreadCount, String avatar, String msg, Integer eventType) {
		return of((NumberUtil.getLong(followedUnreadCount, 0L) + NumberUtil.getLong(visitedUnreadCount, 0L)), avatar, msg, eventType);
	}

	public static LikeMeUnreadDTO of(Long unread, String avatar, String msg, Integer eventType) {
		return new LikeMeUnreadDTO(unread, avatar, msg, eventType);
	}

}
